package com.atguigu.chapter04

import scala.util.control.Breaks._

object TestBreak {

  def main(args: Array[String]): Unit = {
    breakable {
      for (elem <- 1 to 10) {
        println(elem)
        if (elem == 5) break
      }
    }

    println("end")

    for (elem <- 1 to 10) {
      if (elem % 2 == 1) {
        println(elem)
      } else {
        println("continue")
      }
    }

  }

}
